home *** CD-ROM | disk | FTP | other *** search
/ Mac Action 1996 January / mac-action-07.iso / mac / Inside Action / Total Distortion Big Demo / beESPman.Dxr / 00177_ESPman.script.ls < prev    next >
Encoding:
Text File  |  1995-06-05  |  2.8 KB  |  150 lines

  1. property s1, s2, s3, s4, s5, s6, s7, s8, scha1, scha2, scha3, scha4, scha5, scha6, scha7, scha8, sart1, sart2, sart3, sart4, sart5, sart6, sart7, sart8, focalcha, attempts, hits, misses, targetnum, choice, ringcha, chetr
  2.  
  3. on birth me
  4.   set chetr to 0
  5.   set scha1 to 4
  6.   set scha2 to 5
  7.   set scha3 to 6
  8.   set scha4 to 7
  9.   set scha5 to 8
  10.   set scha6 to 9
  11.   set scha7 to 10
  12.   set scha8 to 11
  13.   set sart1 to the number of cast "churchloope"
  14.   set sart2 to the number of cast "earloope"
  15.   set sart3 to the number of cast "eyeloope"
  16.   set sart4 to the number of cast "noseloope"
  17.   set sart5 to the number of cast "mouthloope"
  18.   set sart6 to the number of cast "cdloope"
  19.   set sart7 to the number of cast "handloope"
  20.   set sart8 to the number of cast "faceloope"
  21.   set focalcha to 16
  22.   set ringcha to 15
  23.   set attempts to 0
  24.   set hits to 0
  25.   set misses to 0
  26.   return me
  27. end
  28.  
  29. on drawrand me
  30.   set arti to 0
  31.   puppetSprite(focalcha, 1)
  32.   set targetnum to random(8)
  33.   do("set arti = sart" & targetnum)
  34.   put arti
  35.   set the castNum of sprite focalcha to arti
  36. end
  37.  
  38. on drawchet me, n
  39.   set arti to 0
  40.   puppetSprite(focalcha, 1)
  41.   do("set arti = sart" & n)
  42.   put arti
  43.   set the castNum of sprite focalcha to arti
  44. end
  45.  
  46. on setchet me, n
  47.   set chetr to n
  48. end
  49.  
  50. on selecto me, n
  51.   set choice to n
  52.   if chetr < 1 then
  53.     regselect(me)
  54.   else
  55.     chetselect(me)
  56.   end if
  57. end
  58.  
  59. on chetselect me
  60.   if random(chetr) < 7 then
  61.     drawchet(me, choice)
  62.     set hits to hits + 1
  63.     go("revealhit")
  64.     set attempts to attempts + 1
  65.   else
  66.     regselect(me)
  67.   end if
  68. end
  69.  
  70. on regselect me
  71.   if choice = targetnum then
  72.     set hits to hits + 1
  73.     go("revealhit")
  74.   else
  75.     set misses to misses + 1
  76.     go("revealmiss")
  77.   end if
  78.   set attempts to attempts + 1
  79. end
  80.  
  81. on ringit me
  82.   puppetSprite(ringcha, 1)
  83.   do("set h = the loch of sprite scha" & choice)
  84.   do("set v = the locv of sprite scha" & choice)
  85.   set h to h + 32
  86.   set v to v + 32
  87.   set the locH of sprite ringcha to h
  88.   set the locV of sprite ringcha to v
  89. end
  90.  
  91. on printscore me
  92.   set tx to "Attempts: " & attempts & RETURN & "Correct: " & hits & RETURN & "Wrong: " & misses
  93.   put tx into field "espstat"
  94. end
  95.  
  96. on cleanup me
  97.   puppetSprite(ringcha, 0)
  98.   puppetSprite(focalcha, 0)
  99. end
  100.  
  101. on tryagain me
  102.   cleanup(me)
  103.   go("5")
  104. end
  105.  
  106. on resetscore me
  107.   set attempts to 0
  108.   set hits to 0
  109.   set misses to 0
  110.   printscore(me)
  111. end
  112.  
  113. on FirstPage me
  114.   global NowBPage, BPageMax
  115.   cleanup(me)
  116.   puppetSound("Kick.SE.1")
  117.   go("1")
  118.   set NowBPage to 1
  119. end
  120.  
  121. on PageDN me
  122.   global NowBPage, BPageMax
  123.   cleanup(me)
  124.   if NowBPage = 1 then
  125.     exit
  126.   else
  127.     set NowBPage to NowBPage - 1
  128.   end if
  129.   puppetSound("BookPage.SE.2")
  130.   go(string(NowBPage))
  131. end
  132.  
  133. on HelpOut me
  134.   cleanup(me)
  135.   JumpPage(4)
  136.   puppetSound("DonkBell.SE.1")
  137. end
  138.  
  139. on hitsnd me
  140.   set n to random(4)
  141.   set s to "ESPVoc" & n
  142.   puppetSound(s)
  143. end
  144.  
  145. on misssnd me
  146.   set n to random(21)
  147.   set s to "ESPAww" & n
  148.   puppetSound(s)
  149. end
  150.